package bjtu.tjj.simpledy.controller;

import bjtu.tjj.simpledy.common.CommonResult;
import bjtu.tjj.simpledy.dto.VideoDTO;
import bjtu.tjj.simpledy.service.RecommendService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("recommend")
@RequiredArgsConstructor
public class RecommendController {
    private final RecommendService recommendService;

    @GetMapping
    public CommonResult<List<VideoDTO>> getRecommend(@RequestParam(defaultValue = "10") Integer number) {
        return CommonResult.success(recommendService.getRecommend(number));
    }
}
